package com.bit101.components
{
	import flash.display.Bitmap;
	import flash.display.DisplayObjectContainer;
	import flash.events.Event;
	
	public class ColorRadioBtn extends RadioButton
	{
		
		public var color:String;
		public function ColorRadioBtn(parent:DisplayObjectContainer=null, xpos:Number=0, ypos:Number=0, label:String="", checked:Boolean=false, defaultHandler:Function=null)
		{
			super(parent, xpos, ypos, label, checked, defaultHandler);
		}
		override public function draw():void
		{
			/*
			
			_back.graphics.clear();
			_back.graphics.beginFill(Style.BACKGROUND);
			_back.graphics.drawCircle(5, 5, 5);
			_back.graphics.endFill();
			
			_button.graphics.clear();
			_button.graphics.beginFill(Style.BUTTON_FACE);
			_button.graphics.drawCircle(5, 5, 3);
			
			*/
			
			/*_label.x = 12;
			_label.y = (10 - _label.height) / 2;
			_label.text = _labelText;
			_label.draw();
			_width = _label.width + 12;
			_height = 10;*/
			_width = 35;
			_height = 23;
		}
		public function SetColor(value:uint,embedCls:Class):void{
			_back.graphics.beginFill(0xcccccc);
			_back.graphics.drawRect(0,0,34,23);
			_back.graphics.endFill();
			
			_back.graphics.beginFill(value);
			_back.graphics.drawRect(1,1,33,22);
			_back.graphics.endFill();
			
			var bitmap:Bitmap = new embedCls();
			bitmap.x = 20.5;
			bitmap.y = 10;
			_button.addChild(bitmap);
			this.dispatchEvent(new Event(Event.RESIZE))
		}
	}
}